home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 October: Mac OS SDK / Dev.CD Oct 00 SDK1.toast / Development Kits / Cross Platform / QuickTime 4.1.2 Windows SDK / CIncludes / QuickTimeVRFormat.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-04-12  |  14.4 KB  |  479 lines  |  [TEXT/R*ch]

  1. /*
  2.      File:        QuickTimeVRFormat.h
  3.  
  4.      Contains:    QuickTime VR interfaces
  5.  
  6.      Version:    Technology:    QuickTime VR 2.1
  7.                  Release:    QuickTime 4.1
  8.  
  9.      Copyright:    (c) 1997-1999 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __QUICKTIMEVRFORMAT__
  18. #define __QUICKTIMEVRFORMAT__
  19.  
  20. #ifndef __CONDITIONALMACROS__
  21.     #include <ConditionalMacros.h>
  22. #endif
  23.  
  24. #ifndef __DIALOGS__
  25.     #include <Dialogs.h>
  26. #endif
  27.  
  28. #ifndef __MOVIES__
  29.     #include <Movies.h>
  30. #endif
  31.  
  32. #ifndef __QUICKTIMEVR__
  33.     #include <QuickTimeVR.h>
  34. #endif
  35.  
  36.  
  37.  
  38.  
  39. #if PRAGMA_ONCE
  40. #pragma once
  41. #endif
  42.  
  43. #ifdef __cplusplus
  44. extern "C" {
  45. #endif
  46.  
  47. #if PRAGMA_IMPORT
  48. #pragma import on
  49. #endif
  50.  
  51. #if PRAGMA_STRUCT_ALIGN
  52.     #pragma options align=mac68k
  53. #elif PRAGMA_STRUCT_PACKPUSH
  54.     #pragma pack(push, 2)
  55. #elif PRAGMA_STRUCT_PACK
  56.     #pragma pack(2)
  57. #endif
  58.  
  59.  
  60. /* File Format Version numbers */
  61. #define kQTVRMajorVersion (2)
  62. #define kQTVRMinorVersion (0)
  63.  
  64. /* User data type for the Movie Controller type specifier*/
  65. enum {
  66.     kQTControllerType            = kQTVRControllerSubType,        /* Atom & ID of where our*/
  67.     kQTControllerID                = 1                                /* ...controller name is stored*/
  68. };
  69.  
  70. /* VRWorld atom types*/
  71. enum {
  72.     kQTVRWorldHeaderAtomType    = FOUR_CHAR_CODE('vrsc'),
  73.     kQTVRImagingParentAtomType    = FOUR_CHAR_CODE('imgp'),
  74.     kQTVRPanoImagingAtomType    = FOUR_CHAR_CODE('impn'),
  75.     kQTVRObjectImagingAtomType    = FOUR_CHAR_CODE('imob'),
  76.     kQTVRNodeParentAtomType        = FOUR_CHAR_CODE('vrnp'),
  77.     kQTVRNodeIDAtomType            = FOUR_CHAR_CODE('vrni'),
  78.     kQTVRNodeLocationAtomType    = FOUR_CHAR_CODE('nloc'),
  79.     kQTVRCursorParentAtomType    = FOUR_CHAR_CODE('vrcp'),        /* New with 2.1*/
  80.     kQTVRCursorAtomType            = FOUR_CHAR_CODE('CURS'),        /* New with 2.1*/
  81.     kQTVRColorCursorAtomType    = FOUR_CHAR_CODE('crsr')        /* New with 2.1*/
  82. };
  83.  
  84. /* NodeInfo atom types*/
  85. enum {
  86.     kQTVRNodeHeaderAtomType        = FOUR_CHAR_CODE('ndhd'),
  87.     kQTVRHotSpotParentAtomType    = FOUR_CHAR_CODE('hspa'),
  88.     kQTVRHotSpotAtomType        = FOUR_CHAR_CODE('hots'),
  89.     kQTVRHotSpotInfoAtomType    = FOUR_CHAR_CODE('hsin'),
  90.     kQTVRLinkInfoAtomType        = FOUR_CHAR_CODE('link')
  91. };
  92.  
  93. /* Miscellaneous atom types*/
  94. enum {
  95.     kQTVRStringAtomType            = FOUR_CHAR_CODE('vrsg'),
  96.     kQTVRStringEncodingAtomType    = FOUR_CHAR_CODE('vrse'),        /* New with 2.1*/
  97.     kQTVRPanoSampleDataAtomType    = FOUR_CHAR_CODE('pdat'),
  98.     kQTVRObjectInfoAtomType        = FOUR_CHAR_CODE('obji'),
  99.     kQTVRImageTrackRefAtomType    = FOUR_CHAR_CODE('imtr'),        /* Parent is kQTVRObjectInfoAtomType. Required if track ref is not 1 as required by 2.0 format.*/
  100.     kQTVRHotSpotTrackRefAtomType = FOUR_CHAR_CODE('hstr'),        /* Parent is kQTVRObjectInfoAtomType. Required if track ref is not 1 as required by 2.0 format.*/
  101.     kQTVRAngleRangeAtomType        = FOUR_CHAR_CODE('arng'),
  102.     kQTVRTrackRefArrayAtomType    = FOUR_CHAR_CODE('tref'),
  103.     kQTVRPanConstraintAtomType    = FOUR_CHAR_CODE('pcon'),
  104.     kQTVRTiltConstraintAtomType    = FOUR_CHAR_CODE('tcon'),
  105.     kQTVRFOVConstraintAtomType    = FOUR_CHAR_CODE('fcon')
  106. };
  107.  
  108. enum {
  109.     kQTVRObjectInfoAtomID        = 1,
  110.     kQTVRObjectImageTrackRefAtomID = 1,                            /* New with 2.1, it adds a track reference to select between multiple image tracks*/
  111.     kQTVRObjectHotSpotTrackRefAtomID = 1                        /* New with 2.1, it adds a track reference to select between multiple hotspot tracks*/
  112. };
  113.  
  114. /* Track reference types*/
  115. enum {
  116.     kQTVRImageTrackRefType        = FOUR_CHAR_CODE('imgt'),
  117.     kQTVRHotSpotTrackRefType    = FOUR_CHAR_CODE('hott')
  118. };
  119.  
  120. /* Old hot spot types*/
  121. enum {
  122.     kQTVRHotSpotNavigableType    = FOUR_CHAR_CODE('navg')
  123. };
  124.  
  125. /* Valid bits used in QTVRLinkHotSpotAtom*/
  126. enum {
  127.     kQTVRValidPan                = 1L << 0,
  128.     kQTVRValidTilt                = 1L << 1,
  129.     kQTVRValidFOV                = 1L << 2,
  130.     kQTVRValidViewCenter        = 1L << 3
  131. };
  132.  
  133.  
  134. /* Values for flags field in QTVRPanoSampleAtom*/
  135. enum {
  136.     kQTVRPanoFlagHorizontal        = 1L << 0,
  137.     kQTVRPanoFlagLast            = 1L << 31
  138. };
  139.  
  140.  
  141. /* Values for locationFlags field in QTVRNodeLocationAtom*/
  142. enum {
  143.     kQTVRSameFile                = 0
  144. };
  145.  
  146.  
  147. /* Header for QTVR track's Sample Description record (vrWorld atom container is appended)*/
  148.  
  149. struct QTVRSampleDescription {
  150.     UInt32                             descSize;                    /* total size of the QTVRSampleDescription*/
  151.     UInt32                             descType;                    /* must be 'qtvr'*/
  152.  
  153.     UInt32                             reserved1;                    /* must be zero*/
  154.     UInt16                             reserved2;                    /* must be zero*/
  155.     UInt16                             dataRefIndex;                /* must be zero*/
  156.  
  157.     UInt32                             data;                        /* Will be extended to hold vrWorld QTAtomContainer*/
  158.  
  159. };
  160. typedef struct QTVRSampleDescription    QTVRSampleDescription;
  161. typedef QTVRSampleDescription *            QTVRSampleDescriptionPtr;
  162. typedef QTVRSampleDescriptionPtr *        QTVRSampleDescriptionHandle;
  163. /*
  164.   =================================================================================================
  165.    Definitions and structures used in the VRWorld QTAtomContainer
  166.   -------------------------------------------------------------------------------------------------
  167. */
  168.  
  169.  
  170. struct QTVRStringAtom {
  171.     UInt16                             stringUsage;
  172.     UInt16                             stringLength;
  173.     unsigned char                     theString[4];                /* field previously named "string"*/
  174. };
  175. typedef struct QTVRStringAtom            QTVRStringAtom;
  176. typedef QTVRStringAtom *                QTVRStringAtomPtr;
  177.  
  178.  
  179. struct QTVRWorldHeaderAtom {
  180.     UInt16                             majorVersion;
  181.     UInt16                             minorVersion;
  182.  
  183.     QTAtomID                         nameAtomID;
  184.     UInt32                             defaultNodeID;
  185.     UInt32                             vrWorldFlags;
  186.  
  187.     UInt32                             reserved1;
  188.     UInt32                             reserved2;
  189. };
  190. typedef struct QTVRWorldHeaderAtom        QTVRWorldHeaderAtom;
  191. typedef QTVRWorldHeaderAtom *            QTVRWorldHeaderAtomPtr;
  192.  
  193. /* Valid bits used in QTVRPanoImagingAtom*/
  194. enum {
  195.     kQTVRValidCorrection        = 1L << 0,
  196.     kQTVRValidQuality            = 1L << 1,
  197.     kQTVRValidDirectDraw        = 1L << 2,
  198.     kQTVRValidFirstExtraProperty = 1L << 3
  199. };
  200.  
  201.  
  202. struct QTVRPanoImagingAtom {
  203.     UInt16                             majorVersion;
  204.     UInt16                             minorVersion;
  205.  
  206.     UInt32                             imagingMode;
  207.     UInt32                             imagingValidFlags;
  208.  
  209.     UInt32                             correction;
  210.     UInt32                             quality;
  211.     UInt32                             directDraw;
  212.     UInt32                             imagingProperties[6];        /* for future properties*/
  213.  
  214.     UInt32                             reserved1;
  215.     UInt32                             reserved2;
  216. };
  217. typedef struct QTVRPanoImagingAtom        QTVRPanoImagingAtom;
  218. typedef QTVRPanoImagingAtom *            QTVRPanoImagingAtomPtr;
  219.  
  220. struct QTVRNodeLocationAtom {
  221.     UInt16                             majorVersion;
  222.     UInt16                             minorVersion;
  223.  
  224.     OSType                             nodeType;
  225.     UInt32                             locationFlags;
  226.     UInt32                             locationData;
  227.  
  228.     UInt32                             reserved1;
  229.     UInt32                             reserved2;
  230. };
  231. typedef struct QTVRNodeLocationAtom        QTVRNodeLocationAtom;
  232. typedef QTVRNodeLocationAtom *            QTVRNodeLocationAtomPtr;
  233. /*
  234.   =================================================================================================
  235.    Definitions and structures used in the Nodeinfo QTAtomContainer
  236.   -------------------------------------------------------------------------------------------------
  237. */
  238.  
  239.  
  240. struct QTVRNodeHeaderAtom {
  241.     UInt16                             majorVersion;
  242.     UInt16                             minorVersion;
  243.  
  244.     OSType                             nodeType;
  245.     QTAtomID                         nodeID;
  246.     QTAtomID                         nameAtomID;
  247.     QTAtomID                         commentAtomID;
  248.  
  249.     UInt32                             reserved1;
  250.     UInt32                             reserved2;
  251. };
  252. typedef struct QTVRNodeHeaderAtom        QTVRNodeHeaderAtom;
  253. typedef QTVRNodeHeaderAtom *            QTVRNodeHeaderAtomPtr;
  254.  
  255. struct QTVRAngleRangeAtom {
  256.     Float32                         minimumAngle;
  257.     Float32                         maximumAngle;
  258. };
  259. typedef struct QTVRAngleRangeAtom        QTVRAngleRangeAtom;
  260. typedef QTVRAngleRangeAtom *            QTVRAngleRangeAtomPtr;
  261.  
  262. struct QTVRHotSpotInfoAtom {
  263.     UInt16                             majorVersion;
  264.     UInt16                             minorVersion;
  265.  
  266.     OSType                             hotSpotType;
  267.     QTAtomID                         nameAtomID;
  268.     QTAtomID                         commentAtomID;
  269.  
  270.     SInt32                             cursorID[3];
  271.  
  272.                                                                 /* canonical view for this hot spot*/
  273.     Float32                         bestPan;
  274.     Float32                         bestTilt;
  275.     Float32                         bestFOV;
  276.     QTVRFloatPoint                     bestViewCenter;
  277.  
  278.                                                                 /* Bounding box for this hot spot*/
  279.     Rect                             hotSpotRect;
  280.  
  281.     UInt32                             flags;
  282.     UInt32                             reserved1;
  283.     UInt32                             reserved2;
  284. };
  285. typedef struct QTVRHotSpotInfoAtom        QTVRHotSpotInfoAtom;
  286. typedef QTVRHotSpotInfoAtom *            QTVRHotSpotInfoAtomPtr;
  287.  
  288. struct QTVRLinkHotSpotAtom {
  289.     UInt16                             majorVersion;
  290.     UInt16                             minorVersion;
  291.  
  292.     UInt32                             toNodeID;
  293.  
  294.     UInt32                             fromValidFlags;
  295.     Float32                         fromPan;
  296.     Float32                         fromTilt;
  297.     Float32                         fromFOV;
  298.     QTVRFloatPoint                     fromViewCenter;
  299.  
  300.     UInt32                             toValidFlags;
  301.     Float32                         toPan;
  302.     Float32                         toTilt;
  303.     Float32                         toFOV;
  304.     QTVRFloatPoint                     toViewCenter;
  305.  
  306.     Float32                         distance;
  307.  
  308.     UInt32                             flags;
  309.     UInt32                             reserved1;
  310.     UInt32                             reserved2;
  311. };
  312. typedef struct QTVRLinkHotSpotAtom        QTVRLinkHotSpotAtom;
  313. typedef QTVRLinkHotSpotAtom *            QTVRLinkHotSpotAtomPtr;
  314. /*
  315.   =================================================================================================
  316.    Definitions and structures used in Panorama and Object tracks
  317.   -------------------------------------------------------------------------------------------------
  318. */
  319.  
  320.  
  321. struct QTVRPanoSampleAtom {
  322.     UInt16                             majorVersion;
  323.     UInt16                             minorVersion;
  324.  
  325.     UInt32                             imageRefTrackIndex;            /* track reference index of the full res image track*/
  326.     UInt32                             hotSpotRefTrackIndex;        /* track reference index of the full res hot spot track*/
  327.  
  328.     Float32                         minPan;
  329.     Float32                         maxPan;
  330.     Float32                         minTilt;
  331.     Float32                         maxTilt;
  332.     Float32                         minFieldOfView;
  333.     Float32                         maxFieldOfView;
  334.  
  335.     Float32                         defaultPan;
  336.     Float32                         defaultTilt;
  337.     Float32                         defaultFieldOfView;
  338.  
  339.                                                                 /* Info for highest res version of image track*/
  340.     UInt32                             imageSizeX;                    /* pixel width of the panorama (e.g. 768)*/
  341.     UInt32                             imageSizeY;                    /* pixel height of the panorama (e.g. 2496)*/
  342.     UInt16                             imageNumFramesX;            /* diced frames wide (e.g. 1)*/
  343.     UInt16                             imageNumFramesY;            /* diced frames high (e.g. 24)*/
  344.  
  345.                                                                 /* Info for highest res version of hotSpot track*/
  346.     UInt32                             hotSpotSizeX;                /* pixel width of the hot spot panorama (e.g. 768)*/
  347.     UInt32                             hotSpotSizeY;                /* pixel height of the hot spot panorama (e.g. 2496)*/
  348.     UInt16                             hotSpotNumFramesX;            /* diced frames wide (e.g. 1)*/
  349.     UInt16                             hotSpotNumFramesY;            /* diced frames high (e.g. 24)*/
  350.  
  351.     UInt32                             flags;
  352.     UInt32                             reserved1;
  353.     UInt32                             reserved2;
  354.  
  355. };
  356. typedef struct QTVRPanoSampleAtom        QTVRPanoSampleAtom;
  357. typedef QTVRPanoSampleAtom *            QTVRPanoSampleAtomPtr;
  358. /* Special resolution values for the Image Track Reference Atoms. Use only one value per track reference.*/
  359. enum {
  360.     kQTVRFullTrackRes            = kQTVRFullRes,
  361.     kQTVRHalfTrackRes            = kQTVRHalfRes,
  362.     kQTVRQuarterTrackRes        = kQTVRQuarterRes,
  363.     kQTVRPreviewTrackRes        = 0x8000
  364. };
  365.  
  366.  
  367. struct QTVRTrackRefEntry {
  368.     UInt32                             trackRefType;
  369.     UInt16                             trackResolution;
  370.     UInt32                             trackRefIndex;
  371. };
  372. typedef struct QTVRTrackRefEntry        QTVRTrackRefEntry;
  373. /*
  374.   =================================================================================================
  375.    Object File format 2.0
  376.   -------------------------------------------------------------------------------------------------
  377. */
  378. enum {
  379.     kQTVRObjectAnimateViewFramesOn = (1L << 0),
  380.     kQTVRObjectPalindromeViewFramesOn = (1L << 1),
  381.     kQTVRObjectStartFirstViewFrameOn = (1L << 2),
  382.     kQTVRObjectAnimateViewsOn    = (1L << 3),
  383.     kQTVRObjectPalindromeViewsOn = (1L << 4),
  384.     kQTVRObjectSyncViewToFrameRate = (1L << 5),
  385.     kQTVRObjectDontLoopViewFramesOn = (1L << 6),
  386.     kQTVRObjectPlayEveryViewFrameOn = (1L << 7),
  387.     kQTVRObjectStreamingViewsOn    = (1L << 8)
  388. };
  389.  
  390. enum {
  391.     kQTVRObjectWrapPanOn        = (1L << 0),
  392.     kQTVRObjectWrapTiltOn        = (1L << 1),
  393.     kQTVRObjectCanZoomOn        = (1L << 2),
  394.     kQTVRObjectReverseHControlOn = (1L << 3),
  395.     kQTVRObjectReverseVControlOn = (1L << 4),
  396.     kQTVRObjectSwapHVControlOn    = (1L << 5),
  397.     kQTVRObjectTranslationOn    = (1L << 6)
  398. };
  399.  
  400. enum {
  401.     kGrabberScrollerUI            = 1,                            /* "Object" */
  402.     kOldJoyStickUI                = 2,                            /*  "1.0 Object as Scene"     */
  403.     kJoystickUI                    = 3,                            /* "Object In Scene"*/
  404.     kGrabberUI                    = 4,                            /* "Grabber only"*/
  405.     kAbsoluteUI                    = 5                                /* "Absolute pointer"*/
  406. };
  407.  
  408.  
  409.  
  410. struct QTVRObjectSampleAtom {
  411.     UInt16                             majorVersion;                /* kQTVRMajorVersion*/
  412.     UInt16                             minorVersion;                /* kQTVRMinorVersion*/
  413.     UInt16                             movieType;                    /* ObjectUITypes*/
  414.     UInt16                             viewStateCount;                /* The number of view states 1 based*/
  415.     UInt16                             defaultViewState;            /* The default view state number. The number must be 1 to viewStateCount*/
  416.     UInt16                             mouseDownViewState;            /* The mouse down view state.   The number must be 1 to viewStateCount*/
  417.     UInt32                             viewDuration;                /* The duration of each view including all animation frames in a view*/
  418.     UInt32                             columns;                    /* Number of columns in movie*/
  419.     UInt32                             rows;                        /* Number rows in movie*/
  420.     Float32                         mouseMotionScale;            /* 180.0 for kStandardObject or kQTVRObjectInScene, actual degrees for kOldNavigableMovieScene.*/
  421.     Float32                         minPan;                        /* Start   horizontal pan angle in degrees*/
  422.     Float32                         maxPan;                        /* End     horizontal pan angle in degrees*/
  423.     Float32                         defaultPan;                    /* Initial horizontal pan angle in degrees (poster view)*/
  424.     Float32                         minTilt;                    /* Start   vertical   pan angle in degrees*/
  425.     Float32                         maxTilt;                    /* End     vertical   pan angle in degrees*/
  426.     Float32                         defaultTilt;                /* Initial vertical   pan angle in degrees (poster view)    */
  427.     Float32                         minFieldOfView;                /* minimum field of view setting (appears as the maximum zoom effect) must be >= 1*/
  428.     Float32                         fieldOfView;                /* the field of view range must be >= 1*/
  429.     Float32                         defaultFieldOfView;            /* must be in minFieldOfView and maxFieldOfView range inclusive*/
  430.     Float32                         defaultViewCenterH;
  431.     Float32                         defaultViewCenterV;
  432.  
  433.     Float32                         viewRate;
  434.     Float32                         frameRate;
  435.     UInt32                             animationSettings;            /* 32 reserved bit fields*/
  436.     UInt32                             controlSettings;            /* 32 reserved bit fields*/
  437.  
  438. };
  439. typedef struct QTVRObjectSampleAtom        QTVRObjectSampleAtom;
  440. typedef QTVRObjectSampleAtom *            QTVRObjectSampleAtomPtr;
  441. #if OLDROUTINENAMES
  442.  
  443. typedef QTVRStringAtom                     VRStringAtom;
  444. typedef QTVRWorldHeaderAtom             VRWorldHeaderAtom;
  445. typedef QTVRPanoImagingAtom             VRPanoImagingAtom;
  446. typedef QTVRNodeLocationAtom             VRNodeLocationAtom;
  447. typedef QTVRNodeHeaderAtom                 VRNodeHeaderAtom;
  448. typedef QTVRAngleRangeAtom                 VRAngleRangeAtom;
  449. typedef QTVRHotSpotInfoAtom             VRHotSpotInfoAtom;
  450. typedef QTVRLinkHotSpotAtom             VRLinkHotSpotAtom;
  451. typedef QTVRPanoSampleAtom                 VRPanoSampleAtom;
  452. typedef QTVRTrackRefEntry                 VRTrackRefEntry;
  453. typedef QTVRObjectSampleAtom             VRObjectSampleAtom;
  454. #endif  /* OLDROUTINENAMES */
  455.  
  456.  
  457.  
  458.  
  459. #if PRAGMA_STRUCT_ALIGN
  460.     #pragma options align=reset
  461. #elif PRAGMA_STRUCT_PACKPUSH
  462.     #pragma pack(pop)
  463. #elif PRAGMA_STRUCT_PACK
  464.     #pragma pack()
  465. #endif
  466.  
  467. #ifdef PRAGMA_IMPORT_OFF
  468. #pragma import off
  469. #elif PRAGMA_IMPORT
  470. #pragma import reset
  471. #endif
  472.  
  473. #ifdef __cplusplus
  474. }
  475. #endif
  476.  
  477. #endif /* __QUICKTIMEVRFORMAT__ */
  478.  
  479.